﻿using System;
using System.Collections.Generic;
using Pay.TO;

namespace Pay.DTO {
	/// <summary>
	/// 付款表：charge
	/// </summary>
	[Serializable]
	public class charge_dto {
		public charge_dto() {
			profit = new List<bind_merchant_item>();
		}

		/// <summary>
		/// 订单id
		/// </summary>
		public long id { get; set; }
		/// <summary>
		/// 单号
		/// </summary>
		public string order_no { get; set; }
		/// <summary>
		/// 类型：收款1，升级2，订单3，无分账订单4，充值代付5
		/// </summary>
		public int type { get; set; }
		/// <summary>
		/// 付款小商户号,ext
		/// </summary>
		public string bind_no { get; set; }
		/// <summary>
		/// 商户号:ext
		/// </summary>
		public string merchant_no { get; set; }
		/// <summary>
		/// 商户id
		/// </summary>
		public long merchant_id { get; set; }
		/// <summary>
		/// 收款商户id，空时MerchantId是收款人
		/// </summary>
		public long? bind_id { get; set; }
		/// <summary>
		/// 分润分配［］
		/// </summary>
		public List<bind_merchant_item> profit { get; set; }
		/// <summary>
		/// 支付信息id
		/// </summary>
		public long? pay_id { get; set; }
		/// <summary>
		/// 订单时间
		/// </summary>
		public DateTime order_time { get; set; }
		/// <summary>
		/// 订单状态
		/// </summary>
		public ChargeStatus status { get; set; }
		/// <summary>
		/// 订单金额=应付金额+补贴金额
		/// </summary>
		public decimal order_amount { get; set; }
		/// <summary>
		/// 补贴金额
		/// </summary>
		public decimal subsidy_amount { get; set; }
		/// <summary>
		/// 应付金额
		/// </summary>
		public decimal pay_amount { get; set; }
		/// <summary>
		/// 商户费率
		/// </summary>
		public decimal fee { get; set; }
		/// <summary>
		/// 手续费=应付金额×fee，并向上取整数,如0.283和0.2853都是取0.29
		/// </summary>
		public decimal fee_amount { get; set; }
		/// <summary>
		/// 实收金额＝应付金额－手续费－结算费
		/// </summary>
		public decimal amount { get; set; }
		/// <summary>
		/// 支付成功后服务器回调该地址
		/// </summary>
		public string notify { get; set; }
		/// <summary>
		/// 同步调用商户URL
		/// </summary>
		public string front_notify { get; set; }
		/// <summary>
		/// 卡类型,借记：DC；贷记：CC
		/// </summary>
		public string card_type { get; set; }
		/// <summary>
		/// 如果发起过快捷支付，可以使用之前的返回的快捷支付协议号
		/// </summary>
		public string protocol_no { get; set; }
		/// <summary>
		/// 开户姓名
		/// </summary>
		public string account_name { get; set; }
		/// <summary>
		/// 付款方行卡号
		/// </summary>
		public string account_no { get; set; }
		/// <summary>
		/// 身份证
		/// </summary>
		public string id_card { get; set; }
		/// <summary>
		/// 开户银行编号
		/// </summary>
		public string bank_code { get; set; }
		/// <summary>
		/// 开户银行
		/// </summary>
		public string bank_name { get; set; }
		/// <summary>
		/// 预留手机号
		/// </summary>
		public string mobile { get; set; }
		/// <summary>
		/// 信用卡后三位
		/// </summary>
		public string cvv2 { get; set; }
		/// <summary>
		/// 有效期
		/// </summary>
		public string vaild { get; set; }
		/// <summary>
		/// 失败原因
		/// </summary>
		public string fail { get; set; }

		/// <summary>
		/// o单商户
		/// </summary>
		public merchant_dto merchant { get; set; }
		/// <summary>
		/// 小商户
		/// </summary>
		public merchant_dto binder { get; set; }
		/// <summary>
		/// 支付信息
		/// </summary>
		public pay_info_dto pay_info { get; set; }

		//以下扩展同卡同出

		/// <summary>
		/// 是否同卡同出
		/// </summary>
		public bool is_out { get; set; }
		/// <summary>
		/// 出款－手机号码
		/// </summary>
		public string rcv_mobile { get; set; }
		/// <summary>
		/// 出款－开户银行名称
		/// </summary>
		public string rcv_bank_name { get; set; }
		/// <summary>
		/// 出款－行号
		/// </summary>
		public string rcv_bank_code { get; set; }
		/// <summary>
		/// 出款－账户名称
		/// </summary>
		public string rcv_account_name { get; set; }
		/// <summary>
		/// 出款－卡号
		/// </summary>
		public string rcv_account_no { get; set; }
		/// <summary>
		/// 出款－身份证号
		/// </summary>
		public string rcv_id_card { get; set; }
		/// <summary>
		/// 结算费
		/// </summary>
		public decimal settle_fee { get; set; }

		/// <summary>
		/// o商费率
		/// </summary>
		public decimal merchant_fee { get; set; }
		/// <summary>
		/// O商结算费
		/// </summary>
		public decimal merchant_settle { get; set; }
		/// <summary>
		/// 平台费率
		/// </summary>
		public decimal plat_fee { get; set; }
		/// <summary>
		/// 平台结算费
		/// </summary>
		public decimal plat_settle { get; set; }
	}
}